<template>
    <AppLayout>
        <view class="login-wrapper">
            <AppImage class="bg" src="/static/image/login/bg.png"></AppImage>
            <view class="goback">
                <AppIcon src="/static/image/icon-back.png" size="60" @click="back"></AppIcon>
            </view>
            <view class="header">
                <view> 欢迎使用</view>
                <view class="header-title">副标题 副标题</view>
            </view>
            <view class="content">
                <view class="handle">
                    <image style="width: 50rpx;height: 50rpx; margin-right: 10rpx;"
                        src="/static/image/login/icon-weixin.png"></image>
                    <text>微信用户一键登录</text>
                    <button class="getCaptcha" open-type="getUserInfo" scope="userInfo"
                        @getuserinfo="setLogin">微信一键登录</button>
                </view>
            </view>
        </view>
    </AppLayout>
</template>

<script setup lang="ts">
import AppIcon from "@/components/AppIcon/index.vue"
import AppImage from "@/components/AppImage/index.vue"
import AppLayout from "@/components/AppLayout/index.vue";
import { usePage, useLogin } from "@/hooks";
const { back } = usePage()
const { setLogin } = useLogin()
</script>

<style lang='scss' scoped>
.login-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.bg {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    object-fit: cover;
}

.goback {
    width: 90%;
    display: flex;
    padding-top: 80rpx;
    padding-bottom: 40rpx;
    justify-content: flex-start;
    z-index: 11;
}

.content {
    width: 85%;
    margin-top: auto;
    margin-bottom: 20%;
    z-index: 11;
    text-align: center;
    font-size: 30rpx;
    color: rgba(0, 0, 0, 1);
}

.header {
    width: 85%;
    margin-top: 60rpx;
    font-size: 45rpx;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    z-index: 11;
}

.header-title {
    font-size: 30rpx;
    color: rgba(0, 0, 0, 0.7);
    margin-top: 20rpx;
    font-weight: bold;
}

.handle {
    position: relative;
    background-color: #5BE286;
    border-radius: 20rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 35rpx;
    padding: 20rpx 30rpx;
    margin-bottom: 40rpx;
}

.getCaptcha {
    position: absolute;
    opacity: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
</style>